#!/usr/bin/env bash
tmp=/tmp/model
root=$(cd $(dirname $0);pwd);
if [ -d $tmp ]; then 
	rm $tmp/*
else
	mkdir $tmp
fi
echo generation ...
dia2code -t java -d $tmp $root/../doc/diagramme_classe.dia
echo $(ls $tmp | wc -l) file generated

#clean files
tmpfile=/tmp/file$$
for i in $(ls $tmp); do
	absfile=$tmp/$i
	sed -e '/\/\/.*$/d' $absfile > $tmpfile
	mv $tmpfile $absfile
done

